<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 食堂外卖验证器
 */
class Buy extends AdminBase
{

    // 验证规则
   protected $rule =   [
        
        'userid'              => 'require|number', 
        'passwd'              => 'require|unique:buy',
        'nickname'            => 'require|unique:buy',
        'username'            => 'require|unique:buy',
        'sex'                 => 'require|unique:buy',
        'usertel'             => 'require|number', 
        'usseat'              => 'require|unique:buy',
    ];

    // 验证提示
    protected $message  =   [

        'userid.require'              => '顾客账号不能为空',
        'userid.number'               => '顾客账号必须为数字',
        'passwd.require'               => '密码不能为空',
        'nickname.require'             => '昵称不能为空',
        'username.require'              => '姓名不能为空',
        'sex.require'                  => '性别不能为空',
        'usertel.require'              => '联系方式不能为空',
        'usseat.require'               => '地址不能为空',

    ];

    // 应用场景
    protected $scene = [
        
        'edit' =>  ['userid','passwd','nickname','username','sex','usertel','usseat'],
    ];
    
}
                